<style>
</style>
<style>
  .basicView .el-input.is-disabled .el-input__inner{
    color: black;
  }
  .basicView .el-textarea.is-disabled .el-textarea__inner{
    color: black;
  }
  .basicView .el-radio__input.is-disabled + span.el-radio__label{
    color: black;
  }
  .basicView .el-radio__input.is-checked .el-radio__inner {
       background: #1890ff !important;
       border-color: #1890ff !important;
   }
</style>
<style scoped>
  .tag{
    margin-right:50px;
  }
  .el-upload--picture-card{
    overflow: hidden;
  }
  img{
    width: 146px;
    height: 146px;
  }
  video{
    width: 400px;
    height: 250px;
  }
</style>
<template>
  <div class="app-container basicView" style="background-color:#f3f5fa;">
    <div v-if="!$route.params.type" style="text-align:center;">
      <el-button v-hasPermi="['merchant:basic:list']">
        <router-link :to="{path:'/merchant/basic'}">返 回</router-link>
      </el-button>
    </div>
    <div v-if="$route.params.type" style="display:inline-block;background-color:#ffffff;border-radius:5px;width:400px;vertical-align:top;margin-right:30px;">
      <h5 style="padding-left:40px;">审核进度</h5>
      <div style="min-height:350px;">
        <el-timeline>
          <el-timeline-item
            v-for="(dict, index) in auditStatusMessage"
            :key="index"
            :timestamp="dict.code==0?'否':'是'">
            是否创建{{dict.name}}
          </el-timeline-item>
         </el-timeline>
      </div>
    </div>

    <!-- 添加或修改商户信息对话框 -->
    <div v-if="open" style="display:inline-block;background-color:#ffffff;width:calc(70%-30px);border-radius:5px;padding:0 30px 30px 30px;vertical-align:top;">
      <el-tabs v-model="tag" style="min-width:500px;" @tab-click="changeTag(tag)">
        <el-tab-pane label="商户基本信息" name="1"></el-tab-pane>
        <el-tab-pane v-if="isSubmitBasic" label="商户联系人信息" name="2"></el-tab-pane>
        <el-tab-pane v-if="isSubmitBasic" label="商户银行信息" name="3"></el-tab-pane>
        <el-tab-pane v-if="isSubmitBasic" label="商户扩展信息" name="4"></el-tab-pane>
      </el-tabs>

      <el-form v-show="tag == 1" ref="formBasic" :model="formBasic" :rules="rulesBasic" label-width="80px">
      <div>
        <el-form-item label="商户中文名" prop="cnName">
          <el-input disabled v-model="formBasic.cnName" />
        </el-form-item>
        <el-form-item label="商户简称" prop="shortName">
          <el-input disabled v-model="formBasic.shortName" />
        </el-form-item>
        <el-form-item label="商户英文名" prop="enName">
          <el-input disabled v-model="formBasic.enName" />
        </el-form-item>
        <el-form-item label="商户类型" prop="type">
          <el-select disabled v-model="formBasic.type" >
            <el-option
            v-for="dict in mbiTypeOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="主营产品" prop="mainProduct">
          <el-input disabled v-model="formBasic.mainProduct" />
        </el-form-item>
        <el-form-item label="商户logo" prop="logo">
          <div>
            <div class="el-upload--picture-card">
              <div>
                <img :src="formBasic.logo" alt="">
              </div>
            </div>
          </div>
        </el-form-item>
        <el-form-item label="官网地址" prop="url">
          <el-input disabled v-model="formBasic.url" />
        </el-form-item>
        <el-form-item label="营业执照资料编号" prop="businessDataNo">
          <el-input disabled v-model="formBasic.businessDataNo" />
        </el-form-item>
        <el-form-item label="卫生许可证资料编号" prop="hygienicDataNo">
          <el-input disabled v-model="formBasic.hygienicDataNo" />
        </el-form-item>
        <el-form-item label="食品安全证资料编号" prop="foodSafetyDataNo">
          <el-input disabled v-model="formBasic.foodSafetyDataNo" />
        </el-form-item>
        <el-form-item label="健康证资料编号" prop="healthDataNo">
          <el-input disabled v-model="formBasic.healthDataNo" />
        </el-form-item>
        <el-form-item label="开户许可证资料编号" prop="accountOpeningDataNo">
          <el-input disabled v-model="formBasic.accountOpeningDataNo" />
        </el-form-item>
        <el-form-item label="商户入驻开始日期" prop="settledStartDate">
          <el-date-picker disabled clearable size="small" style="width: 200px"
            v-model="formBasic.settledStartDate"
            type="date"
            value-format="yyyyMMdd">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="商户入驻结束日期" prop="settledEndDate">
          <el-date-picker disabled clearable size="small" style="width: 200px"
            v-model="formBasic.settledEndDate"
            type="date"
            value-format="yyyyMMdd">
          </el-date-picker>
        </el-form-item>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="handleUpdateAudit" v-if="auditButton" v-hasPermi="['merchant:basic:audit']">审 核</el-button>
          <el-button v-hasPermi="['merchant:basic:list']">
            <router-link :to="{path:'/merchant/basic'}">取 消</router-link>
          </el-button>
        </div>
      </div>
      </el-form>

      <el-form v-show="tag == 2" ref="formContact" :model="formContact" :rules="rulesContact" label-width="80px">
      <div>
        <el-form-item label="法人姓名" prop="artificialPersonName">
          <el-input disabled v-model="formContact.artificialPersonName" />
        </el-form-item>
        <el-form-item label="法人联系方式" prop="artificialPersonConcat">
          <el-input disabled v-model="formContact.artificialPersonConcat" />
        </el-form-item>
        <el-form-item label="法人身份证号" prop="artificialPersonIdNo">
          <el-input disabled v-model="formContact.artificialPersonIdNo" />
        </el-form-item>
        <el-form-item label="身份证正面" prop="idCardFront">
          <div>
            <div class="el-upload--picture-card">
              <div>
                <img :src="formContact.idCardFront" alt="">
              </div>
            </div>
          </div>
        </el-form-item>
        <el-form-item label="身份证背面" prop="idCardBack">
          <div>
            <div class="el-upload--picture-card">
              <div>
                <img :src="formContact.idCardBack" alt="">
              </div>
            </div>
          </div>
        </el-form-item>
        <el-form-item label="联系人名称" prop="contactName">
          <el-input disabled v-model="formContact.contactName" />
        </el-form-item>
        <el-form-item label="联系人手机" prop="contactMobile">
          <el-input disabled v-model="formContact.contactMobile" />
        </el-form-item>
        <el-form-item label="联系人座机" prop="contactTelephone">
          <el-input disabled v-model="formContact.contactTelephone" />
        </el-form-item>
        <el-form-item label="地址" prop="address">
          <el-input disabled v-model="formContact.address" />
        </el-form-item>
        <el-form-item label="邮编" prop="post">
          <el-input disabled v-model="formContact.post" />
        </el-form-item>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="handleUpdateAudit" v-if="auditButton" v-hasPermi="['merchant:basic:audit']">审 核</el-button>
          <el-button v-hasPermi="['merchant:basic:list']">
            <router-link :to="{path:'/merchant/basic'}">取 消</router-link>
          </el-button>
        </div>
      </div>
      </el-form>

      <el-form v-show="tag == 3" ref="formBank" :model="formBank" :rules="rulesBank" label-width="80px">
      <div>
        <el-form-item label="结算银行账号" prop="settlementBankNo">
          <el-input disabled v-model="formBank.settlementBankNo" />
        </el-form-item>
        <el-form-item label="银行账号类型" prop="settlementBankNoType">
          <el-select disabled v-model="formBank.settlementBankNoType" >
            <el-option
            v-for="dict in mbiMerchantBankSettlementTypeOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="结算银行卡" prop="settlementBankCard">
          <div>
            <div class="el-upload--picture-card">
              <div>
                <img :src="formBank.settlementBankCard" alt="">
              </div>
            </div>
          </div>
        </el-form-item>
        <el-form-item label="结算银行名称" prop="settlementBankName">
          <el-input disabled v-model="formBank.settlementBankName" />
        </el-form-item>
        <el-form-item label="结算名称" prop="settlementName">
          <el-input disabled v-model="formBank.settlementName" />
        </el-form-item>
        <el-form-item label="开票地址" prop="settlementAddress">
          <el-input disabled v-model="formBank.settlementAddress" />
        </el-form-item>
        <el-form-item label="开票电话" prop="settlementTelephone">
          <el-input disabled v-model="formBank.settlementTelephone" />
        </el-form-item>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="handleUpdateAudit" v-if="auditButton" v-hasPermi="['merchant:basic:audit']">审 核</el-button>
          <el-button v-hasPermi="['merchant:basic:list']">
            <router-link :to="{path:'/merchant/basic'}">取 消</router-link>
          </el-button>
        </div>
      </div>
      </el-form>

      <el-form v-show="tag == 4 && isSubmitBasic" ref="formExtend" :model="formExtend" :rules="rulesExtend" label-width="80px">
      <div>
        <el-form-item label="商户简介" prop="synopsis">
          <el-input disabled v-model="formExtend.synopsis" type="textarea" />
        </el-form-item>
        <el-form-item label="商户图片1">
          <div>
            <div class="el-upload--picture-card">
              <div>
                <img :src="formExtend.showImg1" alt="">
              </div>
            </div>
          </div>
        </el-form-item>
        <el-form-item label="商户图片2">
          <div>
            <div class="el-upload--picture-card">
              <div>
                <img :src="formExtend.showImg2" alt="">
              </div>
            </div>
          </div>
        </el-form-item>
        <el-form-item label="商户图片3">
          <div>
            <div class="el-upload--picture-card">
              <div>
                <img :src="formExtend.showImg3" alt="">
              </div>
            </div>
          </div>
        </el-form-item>
        <el-form-item label="商户视频" ref="showVideo" prop="showVideo">
          <video v-if="formExtend.showVideo"
            :src="formExtend.showVideo"
            class="avatar video-avatar"
            controls="controls">
            您的浏览器不支持视频播放
          </video>
        </el-form-item>
        <el-form-item label="集团商户">
          <el-radio-group disabled v-model="formExtend.groupMerchant">
            <el-radio
              v-for="dict in mbiBasicGroupMerchantOptions"
              :key="dict.dictValue"
              :label="dict.dictValue"
            >
              {{dict.dictLabel}}
            </el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="父商户编号" prop="fatherMerchantNo">
          <el-input disabled v-model="formExtend.fatherMerchantNo" />
        </el-form-item>
        <el-form-item label="父商户名称" prop="fatherMerchantName">
          <el-input disabled v-model="formExtend.fatherMerchantName" />
        </el-form-item>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="handleUpdateAudit" v-if="auditButton" v-hasPermi="['merchant:basic:audit']">审 核</el-button>
          <el-button v-hasPermi="['merchant:basic:list']">
            <router-link :to="{path:'/merchant/basic'}">取 消</router-link>
          </el-button>
        </div>
      </div>
      </el-form>

    </div>

    <!-- 审核对话框 -->
    <el-dialog :title="title" :visible.sync="auditOpen" width="500px" append-to-body>
      <el-form ref="auditForm" :model="auditForm" :rules="auditRules" label-width="80px">
        <el-form-item label="审核结果" prop="examineResult">
          <el-select v-model="auditForm.examineResult" >
            <el-option
            v-for="dict in exaResuOptionsAddAndUpdate"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="审核意见" prop="examineConclusion">
          <el-input v-model="auditForm.examineConclusion" />
        </el-form-item>
        <el-form-item label="审核截止日期" prop="examineEndDate">
          <el-date-picker clearable size="small" style="width: 200px"
            v-model="auditForm.examineEndDate"
            type="date"
            value-format="yyyyMMdd"
            >
          </el-date-picker>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="auditFormSubmit" v-if="auditButton" v-hasPermi="['merchant:basic:audit']">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listBasic, getBasic, getBasicByNo, delBasic, addBasic, updateBasic, exportBasic, getMerchantAuditMessage, auditBasic } from "@/api/merchant/basic";
import { listContact, getContact, delContact, addContact, updateContact, exportContact, getContactByMerchantNo } from "@/api/merchant/contact";
import { listBank, getBank, delBank, addBank, updateBank, exportBank, getBankByMerchantNo } from "@/api/merchant/bank";
import { listExtend, getExtend, delExtend, addExtend, updateExtend, exportExtend, getExtendByMerchantNo } from "@/api/merchant/extend";
import { getExamineInfoByInfoNo } from "@/api/examine/examine";
import { getMerchantProgress } from "@/api/merchant/progress";
import UploadImage from '@/components/UploadImage';
import { getToken } from "@/utils/auth";

export default {
  name: "Basic",
  components: {
    UploadImage,
  },
  data() {
    return {
      // 上传的图片服务器地址
      uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/uploadToLongFileSystem",
      headers: {
        toekn: getToken(),
      },
      //显示的标签页
      tag: '1',
      // 遮罩层
      loading: true,
      // 商户编号
      no: null,
      // 审核编号
      examineCode: null,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 审核进度信息
      auditStatusMessage: [],
      // 商户类型集合
      mbiTypeOptions: [],
      //商户来源类型
      mbiSourceTypeOptions: [],
      //门店类型
      mbiStoreTypeOptions: [],
      //开通电子券
      mbiStoreOpenVoucherOptions: [],
      //主门店
      mbiStoreMainOptions: [],
      //布置二维码
      mbiStoreLayoutQrCodeOptions: [],
      //布置广告
      mbiStoreLayoutAdOptions: [],
      //布置物料
      mbiStoreLayoutMatterOptions: [],
      //资料类型
      mbiDataTypeOptions: [],
      //集团商户
      mbiBasicGroupMerchantOptions: [],
      // 审核结果字典
      exaResuOptions: [],
      // 审核结果字典
      exaResuOptionsAddAndUpdate: [],
      // 商户银行帐号类型字典
      mbiMerchantBankSettlementTypeOptions: [],
      // 是否显示审核按钮
      auditButton: false,
      // 总条数
      total: 0,
      //商户类型
      mbiType: [],
      //商户状态
      mbiStatus: [],
      //资料集合
      datas: [],
      //标记是否查询过资料
      isQueryData: false,
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      viewOpen: false,
      // 是否显示弹出层
      open: false,
      // 是否显示弹出层
      auditOpen: false,
      // 是否提交基础信息
      isSubmitBasic: false,
      // 是否提交门店信息
      isSubmitStore: false,
      // 商户基础信息表单参数
      formBasic: {},
      // 商户联系人信息表单参数
      formContact: {},
      // 商户银行信息表单参数
      formBank: {},
      // 商户扩展信息表单参数
      formExtend: {},
      // 审核表单参数
      auditForm: {},
      //商户基础信息表单校验
      rulesBasic: {
        cnName: [
          { required: true, message: "商户名称不能为空", trigger: "blur" }
        ],
        shortName: [
          { required: true, message: "商户简称不能为空", trigger: "blur" }
        ],
        type: [
          { required: true, message: "商户类型不能为空", trigger: "change" }
        ],
        mainProduct: [
          { required: true, message: "主营产品不能为空", trigger: "change" }
        ],
        logo: [
          { required: true, message: "logo不能为空", trigger: "blur" }
        ],
        agreementNo: [
          { required: true, message: "协议编号不能为空", trigger: "blur" }
        ],
        businessDataNo: [
          { required: true, message: "营业执照资料编号不能为空", trigger: "blur" }
        ],
        hygienicDataNo: [
          { required: true, message: "卫生许可证资料编号不能为空", trigger: "blur" }
        ],
        foodSafetyDataNo: [
          { required: true, message: "食品安全证资料编号不能为空", trigger: "blur" }
        ],
        healthDataNo: [
          { required: true, message: "健康证资料编号不能为空", trigger: "blur" }
        ],
        accountOpeningDataNo: [
          { required: true, message: "开户许可证资料编号不能为空", trigger: "blur" }
        ],
        settledStartDate: [
          { required: true, message: "商户入驻开始日期不能为空", trigger: "blur" }
        ],
        settledEndDate: [
          { required: true, message: "商户入驻结束日期不能为空", trigger: "blur" }
        ]
      },
      //商户联系人信息表单校验
      rulesContact: {
        artificialPersonName: [
          { required: true, message: "法人姓名不能为空", trigger: "blur" }
        ],
        artificialPersonConcat: [
          { required: true, message: "法人联系方式不能为空", trigger: "blur" }
        ],
        artificialPersonIdNo: [
          { required: true, message: "法人身份证号不能为空", trigger: "change" }
        ],
        idCardFront: [
          { required: true, message: "身份证正面不能为空", trigger: "change" }
        ],
        idCardBack: [
          { required: true, message: "身份证背面不能为空", trigger: "blur" }
        ],
        contactName: [
          { required: true, message: "联系人名称不能为空", trigger: "blur" }
        ],
        contactMobile: [
          { required: true, message: "联系人手机不能为空", trigger: "blur" }
        ],
        address: [
          { required: true, message: "地址不能为空", trigger: "blur" }
        ]
      },
      //商户银行信息表单校验
      rulesBank: {
        settlementBankNo: [
          { required: true, message: "结算银行账号不能为空", trigger: "blur" }
        ],
        settlementBankNoType: [
          { required: true, message: "银行账号类型不能为空", trigger: "blur" }
        ],
        settlementBankCard: [
          { required: true, message: "结算银行卡不能为空", trigger: "change" }
        ],
        settlementBankName: [
          { required: true, message: "结算银行名称不能为空", trigger: "change" }
        ],
        settlementName: [
          { required: true, message: "结算名称不能为空", trigger: "blur" }
        ],
        settlementAddress: [
          { required: true, message: "开票地址不能为空", trigger: "blur" }
        ],
        settlementTelephone: [
          { required: true, message: "开票电话不能为空", trigger: "blur" }
        ]
      },
      //商户扩展信息表单校验
      rulesExtend: {
      },
      //商户审核信息表单校验
      auditRules: {
        examineResult: [
          { required: true, message: "审核结果不能为空", trigger: "blur" }
        ]
      }
    };
  },
  //每次进入页面时触发
  activated(){
  },
  //第一次进入页面时触发
  created() {
    this.reset();
    this.tag = "1";
    var params = this.$route.params;
    var type = params.type;
    if(type == 1){
      this.open = true;
      this.isSubmitBasic = false;
    }else if(type == 2 || type == 3 || type == 4){
      this.handleUpdate();
      if(type == 2 || type == 4){
        this.open = true;
        this.isSubmitBasic = true;
      }else if(type == 3){
        this.viewOpen = true;
      }
      var form = {};
      form.merchantNo = this.no;
      getMerchantAuditMessage(form).then(response => {
        this.auditStatusMessage = response.data;
      });
    }
    if(!this.no){
      this.auditStatusMessage.push({name:"商户基本信息",code: "0"})
    }
    this.getDicts("mct_merchant_type").then(response => {
      this.mbiTypeOptions = response.data;
    });
    this.getDicts("mct_merchant_source_type").then(response => {
      this.mbiSourceTypeOptions = response.data;
    });
    this.getDicts("mct_merchant_store_type").then(response => {
      this.mbiStoreTypeOptions = response.data;
    });
    this.getDicts("mct_merchant_store_open_voucher").then(response => {
      this.mbiStoreOpenVoucherOptions = response.data;
    });
    this.getDicts("mct_merchant_store_main").then(response => {
      this.mbiStoreMainOptions = response.data;
    });
    this.getDicts("mct_merchant_store_layout_qr_code").then(response => {
      this.mbiStoreLayoutQrCodeOptions = response.data;
    });
    this.getDicts("mct_merchant_store_layout_ad").then(response => {
      this.mbiStoreLayoutAdOptions = response.data;
    });
    this.getDicts("mct_merchant_store_layout_matter").then(response => {
      this.mbiStoreLayoutMatterOptions = response.data;
    });
    this.getDicts("mct_merchant_data_type").then(response => {
      this.mbiDataTypeOptions = response.data;
    });
    this.getDicts("mct_merchant_group_merchant").then(response => {
      this.mbiBasicGroupMerchantOptions = response.data;
    });
    this.getDicts("msg_message_template_examineResult_type").then(response => {
      this.exaResuOptions = response.data;
      this.exaResuOptions.forEach(element => {
        if(element.dictValue !=0){
          this.exaResuOptionsAddAndUpdate.push(element)
        }
      });
    });
    this.getDicts("mct_merchant_bank_settlement_type").then(response => {
      this.mbiMerchantBankSettlementTypeOptions = response.data;
    });
  },
  methods: {
    // 取消按钮
    cancel() {
      // 是否显示弹出层
      this.auditOpen = false;
    },
    // 表单重置
    reset() {
      // 是否显示弹出层
      this.viewOpen = false,
      // 是否显示弹出层
      this.open = false,
      // 是否显示弹出层
      this.auditOpen = false,
      this.formBasic = {
        id: null,
        no: null,
        cnName: null,
        shortName: null,
        enName: null,
        type: null,
        mainProduct: null,
        status: null,
        logo: null,
        url: null,
        meanNo: null,
        businessDataNo: null,
        hygienicDataNo: null,
        foodSafetyDataNo: null,
        healthDataNo: null,
        accountOpeningDataNo: null,
        settledStartDate: null,
        settledEndDate: null,
        examineCode: null,
        buildOperator: null,
        buildDate: null,
        buildTime: null,
        modifiedOperator: null,
        modifiedDate: null,
        modifiedTime: null
      };
      this.formContact = {
        id: null,
        merchantNo: null,
        artificialPersonName: null,
        artificialPersonConcat: null,
        artificialPersonIdNo: null,
        idCardFront: null,
        idCardBack: null,
        contactName: null,
        contactMobile: null,
        contactTelephone: null,
        address: null,
        post: null,
        examineCode: null,
        buildOperator: null,
        buildDate: null,
        buildTime: null,
        modifiedOperator: null,
        modifiedDate: null,
        modifiedTime: null
      };
      this.formBank = {
        id: null,
        merchantNo: null,
        settlementBankNo: null,
        settlementBankNoType: null,
        settlementBankCard: null,
        settlementBankName: null,
        settlementName: null,
        settlementAddress: null,
        settlementTelephone: null,
        examineCode: null,
        buildOperator: null,
        buildDate: null,
        buildTime: null,
        modifiedOperator: null,
        modifiedDate: null,
        modifiedTime: null
      };
      this.formExtend = {
        id: null,
        merchantNo: null,
        synopsis: null,
        showImg1: null,
        showImg2: null,
        showImg3: null,
        showVideo: null,
        groupMerchant: null,
        fatherMerchantNo: null,
        fatherMerchantName: null,
        examineCode: null,
        buildOperator: null,
        buildDate: null,
        buildTime: null,
        modifiedOperator: null,
        modifiedDate: null,
        modifiedTime: null
      };
      this.resetForm("form");
    },
    /** 修改按钮操作 */
    handleUpdate() {
      const no = this.$route.params.no;
      this.no = no;
      getBasicByNo(no).then(response => {
        this.formBasic = response.data;
      });
      getContactByMerchantNo(no).then(response => {
        if(response.data){
          this.formContact = response.data
        }
      });
      getBankByMerchantNo(no).then(response => {
        if(response.data){
          this.formBank = response.data
        }
      });
      getExtendByMerchantNo(no).then(response => {
        if(response.data){
          this.formExtend = response.data
        }
      });
      var form = {};
      form.merchantNo = no;
      getMerchantProgress(form).then(response => {
        var pro = response.data;
        if(pro&&pro.progressBitmap&&pro.progressBitmap == '1111'){
          getExamineInfoByInfoNo(no).then(response => {
            var examine = response.data;
            if(examine && examine.examineResult && examine.examineResult == 0){
              this.auditButton = true;
            }
          })
        }
      });
    },
    /** 基础信息提交按钮 */
    submitFormBasic() {
      this.$refs["formBasic"].validate(valid => {
        if (valid) {
          if (this.formBasic.id) {
            updateBasic(this.formBasic).then(response => {
              this.msgSuccess("保存成功");
            });
          } else {
            addBasic(this.formBasic).then(response => {
              this.msgSuccess("保存成功");
              this.formBasic = response.data;
              this.no = this.formBasic.no;
              this.examineCode = this.formBasic.examineCode
              if(!this.isSubmitBasic){
                this.isSubmitBasic = true;
              }
              var form = {};
              form.merchantNo = this.no;
              getMerchantAuditMessage(form).then(response => {
                this.auditStatusMessage = response.data;
              });
            });
          }
        }
      });
    },
    /** 联系人信息提交按钮 */
    submitFormContact() {
      this.$refs["formContact"].validate(valid => {
        if (valid) {
          if (!this.formContact.id) {
            this.formContact.merchantNo = this.formBasic.no;
            this.formContact.examineCode = this.formBasic.examineCode;
          }
          updateContact(this.formContact).then(response => {
            this.msgSuccess("保存成功");
            this.formContact = response.data;
          });
        }
      });
    },
    /** 银行信息提交按钮 */
    submitFormBank() {
      this.$refs["formBank"].validate(valid => {
        if (valid) {
          if (!this.formBank.id) {
            this.formBank.merchantNo = this.formBasic.no;
            this.formBank.examineCode = this.formBasic.examineCode;
          }
          updateBank(this.formBank).then(response => {
            this.msgSuccess("保存成功");
            this.formBank = response.data;
          });
        }
      });
    },
    /** 扩展信息提交按钮 */
    submitFormExtend() {
      this.$refs["formExtend"].validate(valid => {
        if (valid) {
          if (!this.formExtend.id) {
            this.formExtend.merchantNo = this.formBasic.no;
            this.formExtend.examineCode = this.formBasic.examineCode;
          }
          updateExtend(this.formExtend).then(response => {
            this.msgSuccess("保存成功");
            this.formExtend = response.data;
          });
        }
      });
    },
    /** 审核按钮 */
    handleUpdateAudit() {
      this.auditOpen = true;
    },
    /** 审核提交按钮 */
    auditFormSubmit(index) {
      this.$refs.auditForm.validate(valid => {
        if(valid){
          var form = this.auditForm;
          form.infoNo = this.no;
          form.examineCode = this.formBasic.examineCode;

          auditBasic(form).then(response => {
            this.msgSuccess("审核成功");
            this.auditOpen = false;
          });
        }
      });
    },
    //修改内容
    changeTag(index) {
    }
  }
};
</script>
